fix: Modify logging behavior when explicitly adding NullLogger with custom config#2594
fix: Modify logging behavior when explicitly adding NullLogger with custom config#2594filzrev wants to merge 1 commit intodotnet:masterfrom
Conversation
|
@filzrev Sorry, but I do not understand the original problem. If we pass a custom config with NullLogger to BenchmarkRunner or BenchmarkSwitcher, it is expected that we will not see the output. What's wrong with this behavior? |
The logger that is returned from
BenchmarkDotNet/src/BenchmarkDotNet/Running/BenchmarkSwitcher.cs Lines 93 to 123 in ca5dfdf And this logger is not used for running actual benchmarks. I'm output console logs by using But when setting |
|
Close this PR,
|
This PR intended to fix problem no console log is outputted when following conditions met.
NullLoggerexplicitlyGlobal Config(passing config asBenchmarkSwitcher::Runparameters)..Currently BenchmarkDotNet use
ConsoleLoggerto print errors and list of benchmarks if logger is not enabled.But when explicitly set
NullLoggerit's not works and no console logs are outputted.Background
I'm trying to write custom progress logger that resolve #190 issue.
And it'll be implemented by using custom
EventProcessorthat is added from v0.13.9.So It need to suppress default
ConsoleLoggerby addingNullLogger.Because when no logger specified following error is recorded.
It works almost as intended.
But when passing custom config to
BenchmarkSwitcher::Runargument. console log is not outputted.